package easybooking.data;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 * Implementation of the Interface <code>Airport</code>.
 * @see Airport
 * @author Hakan Keles
 */
// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
// #[regen=yes,id=DCE.EB1325B4-1A5F-3B58-15A2-83103BC22A54]
// </editor-fold> 
public class AirportImpl extends UnicastRemoteObject implements Airport {

    /**
     * Id of the airport.
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.7B040743-A978-73D4-681B-7266E6E9B63A]
    // </editor-fold> 
    private int airportId = 0;
    /**
     * Name of the airport.
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.181255AC-E97A-9314-2CA9-9ACDB1664F05]
    // </editor-fold> 
    private String name = "";
    /**
     * Initials of the airport.
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.84A8121E-4179-61AF-ECDD-FF593558271E]
    // </editor-fold> 
    private String initials = "";
    /**
     * City of the airport.
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.CBC9F2E9-BCDC-506C-E530-01CAD2BA74F0]
    // </editor-fold> 
    private String city = "";
    /**
     * Status of the airport.
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.59021901-A01A-FED7-AA3E-A99E756BC936]
    // </editor-fold> 
    private boolean isActive = true;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.8350726C-DEF9-E473-1524-C6ECE71F0557]
    // </editor-fold> 
    public AirportImpl() throws RemoteException {
    }

    /**
     * Read-out the ID of the airport.
     * @return ID
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.ECDF049C-84FF-3306-A180-152C8DB36622]
    // </editor-fold> 
    public int getAirportId() throws RemoteException {
        return this.airportId;
    }

    /**
     * Read-out the name of the airport.
     * @return name
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.CF7BC76F-7BC4-6210-E910-0DDF6AEBEC41]
    // </editor-fold> 
    public String getName() throws RemoteException {
        return this.name;
    }

    /**
     * Read-out the initials of the airport.
     * @return initials
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.A672FC3F-0FB9-4C37-EFEF-768EE2AED7DE]
    // </editor-fold> 
    public String getInitials() throws RemoteException {
        return this.initials;
    }

    /**
     * Read-out the city of the airport.
     * @return city
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.8AE15C4C-17FE-CF28-3001-A146C5193020]
    // </editor-fold> 
    public String getCity() throws RemoteException {
        return this.city;
    }

    /**
     * Read-out the status of the airport.
     * @return status
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.B657FA73-B46E-D234-2395-C480EB790C3F]
    // </editor-fold> 
    public boolean getIsActive() throws RemoteException {
        return this.isActive;
    }

    /**
     * Set the ID of the airport.
     * @param airlineId The id of the airport.
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.82CC2BC7-00CC-F361-8455-22E67F6FA04E]
    // </editor-fold> 
    public void setAirportId(int airportId) throws RemoteException {
        this.airportId = airportId;
    }

    /**
     * Set the name of the airport.
     * @param name The name of the airport.
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.9D2E575F-EBA2-F789-D4A7-8A1E9F89DDCC]
    // </editor-fold> 
    public void setName(String name) throws RemoteException {
        this.name = name;
    }

    /**
     * Set the initials of the airport.
     * @param initials The initials of the airport.
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.E9213156-F699-8DDA-0C41-8CA0BFBBBD96]
    // </editor-fold> 
    public void setInitials(String initials) throws RemoteException {
        this.initials = initials;
    }

    /**
     * Set the city of the airport.
     * @param city The city of the airport.
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.21901609-4F99-718E-A240-58C06F6FEFF4]
    // </editor-fold> 
    public void setCity(String city) throws RemoteException {
        this.city = city;
    }

    /**
     * Set the status of the airport.
     * @param status The status of the airport.
     * @throws java.rmi.RemoteException
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.703832A0-23C4-889A-7A1D-4866BB8FB6AD]
    // </editor-fold> 
    public void setIsActive(boolean status) throws RemoteException {
        this.isActive = status;
    }
//     @Override
//    public boolean equals(Object obj) throws RemoteException {
//        if (obj == null) {
//            return false;
//        }
//        if (getClass() != obj.getClass()) {
//            return false;
//        }
//        final AirportImpl other = (AirportImpl) obj;
//        if (this.airportId != other.airportId) {
//            return false;
//        }
//        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
//            return false;
//        }
//        if ((this.initials == null) ? (other.initials != null) : !this.initials.equals(other.initials)) {
//            return false;
//        }
//        if ((this.city == null) ? (other.city != null) : !this.city.equals(other.city)) {
//            return false;
//        }
//        if (this.isActive != other.isActive) {
//            return false;
//        }
//        return true;
//    }
//
//     //     @Override
//    public int hashCode() throws RemoteException{
//        int hash = 5;
//        hash = 83 * hash + this.airportId;
//        hash = 83 * hash + (this.name != null ? this.name.hashCode() : 0);
//        hash = 83 * hash + (this.initials != null ? this.initials.hashCode() : 0);
//        hash = 83 * hash + (this.city != null ? this.city.hashCode() : 0);
//        hash = 83 * hash + (this.isActive ? 1 : 0);
//        return hash;
//    }
//
}

